package com.coke.spring.seata.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

/**
 * @author cwm
 * @Description TODO
 * @date 2021/9/3 下午3:08
 * @Version 1.0
 */
@Data
@TableName("t_stock")
public class Stock {
    /**
     * id
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    /**
     * 商品id
     */
    @TableField("product_id")
    private Integer productId;
    /**
     * 剩余库存
     */
    @TableField(update = "%s-1",updateStrategy= FieldStrategy.IGNORED)
    private Integer num;
}
